<?php
namespace app\mobile\model;

/**
 * Class MemberBrowse
 * @package app\mobile\model     会员浏览记录表
 */
class MemberBrowse extends BaseModel
{
    /*
     * 输出会员浏览记录
     */
    public function echo_browse($member_id)
    {
        $data = self::where('member_id',$member_id)->count();
        return $data;
    }

    public function setCreateTimeAttr()
    {
        return date('Y-m-d');
    }
    /*
     * 浏览记录和商品多对一
     */
    public function shopGoods()
    {
        return $this->belongsTo('ShopGoods','goods_id','id');
    }
}